package main

import (
	"fmt"
	"net"
)

func main() {
	listen, err := net.Listen("tcp", ":9999")
	if err != nil {
		fmt.Println("server start error")
	}

	conn, err := listen.Accept()
	if err != nil {
		fmt.Println("listener is error")
	}
	// 开启线程去处理
	go handlerConnect(conn)
}

func handlerConnect(conn net.Conn) []byte {

	defer conn.Close()

	var body2 = make([]byte, 524288)

	conn.Write(body2)

	return body2
}
